<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css">
<script src="/bsc/static/js/jquery-3.1.1.js"></script>
<script src="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>

</head>
<body>
		<center>
		<form action="<%=basePath%>bagselect" method="post">
			礼包编号：
			<input type="text" name="bag_id" />
			礼包名称：
			<input type="text" name="bag_name"/>
			状态：
			<select name="status">
							<option value="">-请选择-</option>
							<option value="1">在售</option>
							<option value="2">下架</option>
				</select>
					<input type="submit" value="查询" /> 
					<input type="reset" value="重置" />
					<input type="button" value="添加"  onclick="insertbag()"> 
		</form>
			<table class="table table-bordered" >
				<tr>
					<td>礼包编号</td>
					<td>礼包名称</td>
					<td>礼包价格</td>
					<td>开卡数量</td>
					<td>剩余卡数量</td>
					<td>上架时间</td>
					<td>下架时间</td>
					<td>过期时间（天）</td>
					<td>状态</td>
					<td>创建时间</td>
					<td>排序号</td>
					<td>操作</td>
				</tr>
				<c:forEach items="${list }" var="cx">
					<tr>
						<td>${cx.bag_id }</td>
						<td>${cx.bag_name }</td>
						<td>${cx.bag_total_price }</td>
						<td>${cx.open_card_num }</td>
						<td>${cx.remain_num }</td>
						<td>${cx.putaway_time }</td>
						<td>${cx.soldout_time }</td>
						<td>${cx.overdue_time }</td>
						<td>${cx.status=='1'?'在售':'下架' }</td>
						<td>${cx.create_time }</td>
						<td>${cx.sort_no }</td>
						<td>
							<a href="<%=basePath%>bagdel/${cx.bag_id}">删除</a> |
							<a href="<%=basePath%>bagupdByid/${cx.bag_id}">修改</a> 
						<%-- 	<input type="button" value="查看详情"  onclick="bagselByid(${cx.project_id})" />	 --%>
						</td>
					</tr>
				</c:forEach>
			</table>		
		</center>
</body>
</html>
<script type="text/javascript">
<%--
function selectByid(id){
	 $.ajax({
		type:"post",
		url:"<%=basePath%>bagselByid",
		data:{project_id:id},
		dataType:"json",
		success:function(msg){
			$("#project_name").val(msg.project_name);
			$("#status").val(msg.status);
			$("#cover_photo").prop("src",msg.cover_photo);
			$("#cover_big_photo").prop("src",msg.cover_big_photo);
			$("#type_id").val(msg.type_id);
			$("#use_device").val(msg.use_device);
			$("#server_time").val(msg.server_time);
			$("#rmb_price").val(msg.rmb_price);
			$("#beauty_price").val(msg.beauty_price);
			$("#manual_price").val(msg.manual_price);
			$("#active_price").val(msg.active_price);
			$("#sort_no").val(msg.sort_no);
			$("#content").val(msg.content);
		}
	})
	$("#myModal").modal("show");
	
} --%>

var insertbag = function(){
	
	window.location.href="<%=basePath%>addinsert";
	
}
</script>